﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using CodeCamp;
using CodeCamp.Controllers;
using RLTT = RGoodSW.Logger.Test.TestMockLogger;

namespace CodeCamp.Tests.Controllers
{
    [TestClass]
    public class HomeControllerTest
    {
        private static class Tags
        {
            internal const string defaultEventShortName = "defaultEventShortName";
        }
        private string _defaultEventName;

        public HomeControllerTest()
        {
            _defaultEventName = ConfigurationManager.AppSettings[Tags.defaultEventShortName];
            if (string.IsNullOrWhiteSpace(_defaultEventName))
                _defaultEventName = "CC17";
        }

        [TestMethod]
        public void Index()
        {
            // Arrange
            HomeController controller = new HomeController(new CodeCamp.Infrastructure.DefaultValueProvider(),
                                            new RLTT.TestLogger());

            // Act
            ViewResult result = controller.Index(_defaultEventName) as ViewResult;

            // Assert
            //Assert.AreEqual("Welcome to ASP.NET MVC!", result.ViewBag.Message);
        }

        [TestMethod]
        public void About()
        {
            // Arrange
            HomeController controller = new HomeController(new CodeCamp.Infrastructure.DefaultValueProvider(),
                                            new RLTT.TestLogger());

            // Act
            ViewResult result = controller.About(_defaultEventName) as ViewResult;

            // Assert
            Assert.IsNotNull(result);
        }
    }
}
